package com.molihub.service.impl;

import com.molihub.entity.Message;
import com.molihub.mapper.MessageMapper;
import com.molihub.service.MessageService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName: MessageMapperImpl
 * @Description: TODO
 * @author: GGBOY
 * @date 2020/2/22 15:31
 * @Version: 1.0
 **/
@Service
public class MessageServiceImpl extends BaseService implements MessageService {
    @Override
    public Message getMessageById(int messageId) {
        return messageMapper.getMessageById(messageId);
    }

    @Override
    public List<Message> getAllMessage(int userId) {
        return messageMapper.getAllMessage(userId);
    }


    @Override
    public List<Message> getAllMessageWithCondition(int userId, boolean looked) {
        return messageMapper.getAllMessageWithCondition(userId, looked);
    }

    @Override
    public List<Message> getMessagesByType(int userId, int type) {
        return messageMapper.getMessagesByType(userId, type);
    }

    @Override
    public void setMessagesLooked(int userId, int type) {
        messageMapper.setMessagesLooked(userId, type);
    }

    @Override
    public void deleteMessages(int userId, int type) {
        messageMapper.deleteMessages(userId, type);
    }

    @Override
    public void deleteMessage(int messageId) {
        messageMapper.deleteMessage(messageId);
    }

    @Override
    public Integer addRecord(Message message) {
        return messageMapper.addRecord(message);
    }
}
